@use "sass:color";

// 定义颜色变量
$primary: #6366f1;
$primary-light: #818cf8;
$primary-dark: #4f46e5;
$secondary: #ec4899;
$accent: #f59e0b;
$success: #10b981;
$gradient-start: #667eea;
$gradient-end: #764ba2;

.page {
  min-height: 100vh;
  background: linear-gradient(135deg, 
    #f0f4ff 0%, 
    #e8f0fe 25%,
    #f5f7fa 50%,
    #f0f2f5 75%,
    #eef2ff 100%
  );
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

// 装饰性背景元素
.page::before {
  content: "";
  position: fixed;
  top: -50%;
  right: -20%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: float 20s ease-in-out infinite;
}

.page::after {
  content: "";
  position: fixed;
  bottom: -30%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
}

// 顶部导航栏
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(30px) brightness(1.1);
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
  box-shadow: 
    0 4px 20px rgba(99, 102, 241, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #475569;
  text-decoration: none;
  border: 1px solid rgba(99, 102, 241, 0.1);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.close::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.close:hover {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: rgba(99, 102, 241, 0.2);
  transform: scale(1.08) rotate(90deg);
  box-shadow: 
    0 6px 20px rgba(99, 102, 241, 0.15),
    0 2px 6px rgba(0, 0, 0, 0.1);
  color: $primary;
}

.close:hover::before {
  width: 100px;
  height: 100px;
}

.close:active {
  transform: scale(0.95) rotate(90deg);
}

.tabs {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
  padding: 6px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(255, 255, 255, 0.8);
}

.tab {
  padding: 10px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tab::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.tab:hover {
  color: $primary;
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}

.tab:hover::before {
  width: 200px;
  height: 200px;
}

.tabActive {
  color: #ffffff;
  background: linear-gradient(135deg, $primary 0%, $primary-light 100%);
  font-weight: 600;
  box-shadow: 
    0 4px 12px rgba(99, 102, 241, 0.3),
    0 2px 4px rgba(99, 102, 241, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.tabActive::before {
  display: none;
}

// 主内容区
.content {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

// 左侧导航面板
.sidebar {
  width: 160px;
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
  backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid rgba(99, 102, 241, 0.1);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    4px 0 20px rgba(99, 102, 241, 0.05),
    inset -1px 0 0 rgba(255, 255, 255, 0.8);
  position: relative;
  z-index: 10;
}

.sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%,
    rgba(99, 102, 241, 0.2) 50%,
    transparent 100%
  );
}

.gradeNav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 14px;
}

.gradeItem {
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  color: #475569;
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  font-weight: 500;
  overflow: hidden;
}

.gradeItem::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.gradeItem:hover {
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.1) 0%, 
    rgba(99, 102, 241, 0.05) 100%
  );
  color: $primary;
  transform: translateX(4px);
  border-color: rgba(99, 102, 241, 0.15);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.gradeItem:hover::before {
  width: 150px;
  height: 150px;
}

.gradeItemActive {
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.15) 0%, 
    rgba(99, 102, 241, 0.08) 100%
  );
  color: $primary;
  font-weight: 600;
  box-shadow: 
    0 4px 12px rgba(99, 102, 241, 0.15),
    0 2px 4px rgba(99, 102, 241, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateX(2px);
}

.gradeItemActive::before {
  width: 150px;
  height: 150px;
}

.gradeItemActive::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: linear-gradient(180deg, $primary 0%, $primary-light 100%);
  border-radius: 0 4px 4px 0;
  box-shadow: 
    0 0 12px rgba(99, 102, 241, 0.5),
    0 0 6px rgba(99, 102, 241, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: translateY(-50%) scaleY(1); }
  50% { opacity: 0.8; transform: translateY(-50%) scaleY(0.95); }
}

// 右侧主内容区
.main {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  background: transparent;
  transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.main::-webkit-scrollbar {
  width: 8px;
}

.main::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 4px;
}

.main::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, $primary 0%, $primary-light 100%);
  border-radius: 4px;
  transition: background 0.3s;
}

.main::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, $primary-dark 0%, $primary 100%);
}

.empty {
  text-align: center;
  color: #64748b;
  padding: 100px 20px;
  font-size: 18px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: relative;
}

.empty::before {
  content: "✨";
  font-size: 64px;
  opacity: 0.7;
  animation: bounce 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.25));
  line-height: 1;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.activityList {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.activityCard {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
  backdrop-filter: blur(20px) saturate(180%);
  border-radius: 20px;
  padding: 28px 32px;
  border: 1px solid rgba(99, 102, 241, 0.1);
  box-shadow: 
    0 8px 32px rgba(99, 102, 241, 0.08),
    0 4px 16px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  cursor: default;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.activityCard::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, 
    $primary 0%, 
    $primary-light 50%,
    $secondary 100%
  );
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
  pointer-events: none;
  z-index: 0;
}

.activityCard::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, 
    rgba(99, 102, 241, 0.05) 0%, 
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 0;
}

.activityCard:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 
    0 16px 48px rgba(99, 102, 241, 0.15),
    0 8px 24px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: rgba(99, 102, 241, 0.25);
}

.activityCard:hover::before {
  transform: scaleY(1);
}

.activityCard:hover::after {
  opacity: 1;
}

.activityTitle {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, 
    #1e293b 0%,
    $primary 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  line-height: 1.4;
  letter-spacing: -0.02em;
  position: relative;
  padding-left: 12px;
}

.activityTitle::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, $primary 0%, $primary-light 100%);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
  pointer-events: none;
}

.activityItems {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.activityItem {
  font-size: 14px;
  color: #64748b;
  padding: 14px 18px;
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.03) 0%,
    rgba(236, 72, 153, 0.02) 100%
  );
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-left: 4px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
  overflow: hidden;
  font-weight: 500;
  z-index: 1;
}

.activityItem::before {
  content: "→";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  opacity: 0;
  color: $primary;
  font-weight: bold;
  transition: all 0.3s;
  pointer-events: none;
  z-index: 1;
}

.activityItem::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, 
    rgba(99, 102, 241, 0.1) 0%,
    rgba(99, 102, 241, 0.05) 100%
  );
  transition: width 0.3s;
  pointer-events: none;
  z-index: 0;
}

.activityItem:hover {
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.1) 0%,
    rgba(99, 102, 241, 0.05) 100%
  );
  border-left-color: $primary;
  border-color: rgba(99, 102, 241, 0.2);
  color: $primary;
  transform: translateX(6px) translateY(-2px);
  box-shadow: 
    0 4px 12px rgba(99, 102, 241, 0.15),
    0 2px 4px rgba(99, 102, 241, 0.1);
}

.activityItem:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.activityItem:hover::after {
  width: 100%;
}

.activityType {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
  font-weight: 500;
}

// 响应式设计
@media (max-width: 768px) {
  .page::before,
  .page::after {
    display: none;
  }

  .topbar {
    padding: 0 16px;
    height: 60px;
  }

  .close {
    width: 36px;
    height: 36px;
  }

  .tabs {
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
  }

  .tab {
    padding: 8px 18px;
    font-size: 13px;
  }

  .content {
    flex-direction: column;
  }

  .sidebar {
    width: 100% !important;
    border-right: none;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    max-height: 200px;
    box-shadow: 
      0 4px 12px rgba(99, 102, 241, 0.05),
      inset 0 -1px 0 rgba(255, 255, 255, 0.8);
  }

  .sidebar::before {
    display: none;
  }

  .gradeNav {
    flex-direction: row;
    overflow-x: auto;
    padding: 14px 16px;
    gap: 8px;
    scrollbar-width: thin;
  }

  .gradeNav::-webkit-scrollbar {
    height: 4px;
  }

  .gradeNav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 2px;
  }

  .gradeNav::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, $primary 0%, $primary-light 100%);
    border-radius: 2px;
  }

  .gradeItem {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 10px 18px;
  }

  .gradeItemActive::after {
    display: none;
  }

  .gradeItemActive {
    background: linear-gradient(135deg, 
      rgba(99, 102, 241, 0.15) 0%, 
      rgba(99, 102, 241, 0.08) 100%
    );
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: 
      0 2px 8px rgba(99, 102, 241, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  .main {
    padding: 20px 16px;
  }

  .activityList {
    gap: 16px;
  }

  .activityCard {
    padding: 20px 24px;
    border-radius: 16px;
  }

  .activityTitle {
    font-size: 18px;
    margin-bottom: 16px;
  }

  .activityItems {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .activityItem {
    padding: 12px 16px;
  }

  .empty {
    padding: 60px 20px;
  }

  .empty::before {
    font-size: 48px;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 0 12px;
    height: 56px;
  }

  .close {
    width: 32px;
    height: 32px;
  }

  .tabs {
    gap: 3px;
    padding: 3px;
  }

  .tab {
    padding: 6px 14px;
    font-size: 12px;
  }

  .main {
    padding: 16px 12px;
  }

  .activityCard {
    padding: 16px 20px;
  }

  .activityTitle {
    font-size: 16px;
  }

  .activityItem {
    font-size: 13px;
    padding: 10px 14px;
  }
}

